To create an attribute,
you first create an attribute definition, which stores the characteristics
of the attribute.
The
characteristics include the tag, which is a name that identifies
the attribute, the prompt displayed when you insert the block, value
information, text formatting, location within the block, and any
optional modes (Invisible, Constant, Verify, Preset, Lock Position,
and Multiple Lines).
If you plan to extract the attribute information
for use in a parts list, you may want to keep a list of the attribute
tags you have created. You will need this tag information later
when you create the attribute template file.
Choose Attribute Modes
Attribute modes control
the behavior of attributes in blocks. For example, you can control
- Whether an attribute is visible or invisible
in the drawing
- Whether an attribute has a constant value,
such as a part number
- Whether the attribute can be moved relative
to the rest of the block
- Whether the attribute is a single-line
attribute or a multiple-line attribute
If an attribute has a
constant value, you will not be prompted for its value when you
insert the block. If an attribute has a variable value, such as
the asset number of a computer, you will be prompted when you insert
the block.
Understand Single-Line
and Multiple-Line Attributes
There are several differences
between single-line and multiple-line attributes.
- Single-line attributes are limited to
255 characters from the user interface.
- Multiple-line attributes provide more
formatting options than single-line attributes.
- When editing single-line and multiple
line attributes, different editors are displayed.
- Multiple line attributes display four
grips similar to MTEXT objects, while single-line attributes display
only one grip.
- When a drawing is saved to AutoCAD 2007
or earlier, a multiple-line attribute is converted to several single-line
attributes, one for every line of text in the original multiple-line
attribute. If the drawing file is opened in the current release,
these single line attributes are automatically merged back into
a multiple-line attribute.
NoteIf a multiple-line
attribute makes a round trip to an earlier release of AutoCAD,
the differences between these two types of attributes might result in
truncating very long lines of text and loss of formatting. However,
before any characters are truncated, AutoCAD displays a dialog
box that lets you cancel the operation.
Correct Mistakes in Block
Attribute Definitions
If
you make a mistake, you can use the Properties palette or DDEDIT to make limited
changes to an attribute definition before it is associated with
a block. If you need to make more extensive changes, delete the
attribute definition and create a new one.
Attach Attributes to Blocks
After
you create one or more attribute definitions, you attach the attributes to
a block when you define or redefine that block. When you are prompted to
select the objects to include in the block definition, include in
the selection set any attributes you want to attach to the block.
To use several attributes together, define them
and then include them in the same block. For example, you can define
attributes tagged "Type," "Manufacturer," “Model,” and “Cost,” and
then include them in a block called CHAIR.
Usually,
the order of the attribute prompts is the same as the order in which you
selected the attributes when you created the block. However, if
you used crossing or window selection to select the attributes,
the order of the prompts is the reverse of the order in which you
created attributes. You can use the Block Attribute Manager to change
the order in which you are prompted for attribute information when
you insert the block reference.
When you open a block
definition in the Block Editor, you can use the Attribute Order
dialog box to change the order in which you are prompted for attribute
information when you insert the block reference.
Use Attributes Without
Attaching Them to Blocks
Stand-alone
attributes can also be created. Once attributes have been defined,
and the drawing is saved, this drawing file can be inserted into another
drawing. When the drawing is inserted, you are prompted for the attribute
values.
To create an attribute
definition
- In the Attribute Definition dialog box,
set the attribute modes and enter tag information, location, and
text options.
- (Optional) Under Text Settings, Boundary
Width, specify a value.
- (Optional) Click the Multiline In-Place
Text Editor button to use the in-place text editor to format the
attribute in the drawing.
- Click OK.
After creating the attribute definition, you
can select it as an object while creating a block definition. If
the attribute definition is incorporated into a block, whenever
you insert the block, you are prompted with the text string you
specified for the attribute. Each subsequent instance of the block
can have a different value specified for the attribute.
To edit an attribute definition
before it is associated with a block
-
- Select the attribute to edit.
- In the Edit Attribute Definition dialog
box, specify the attribute tag, prompt, and default value. Then
click OK.
To change the prompt order
of attribute definitions
- In the Block Editor, select a block attribute.
- Right-click in the Block Editor drawing
area.
- Click Attribute Order.
- In the Attribute Order dialog box, select
an attribute definition.
- Click Move Up or Move Down to change
the prompt order of the attribute definitions.
- Repeat steps 2 and 3 until the attribute
definition list is in the desired order.
- Click OK.
CommandsATTDEF
Creates an attribute
definition for storing data in a block.
ATTDISP
Controls the visibility
overrides for all block attributes in a drawing.
BATTORDER
Specifies the order
of attributes for a block.
DDEDIT
Edits single-line text,
dimension text, attribute definitions, and feature control frames.
PROPERTIES
Controls properties
of existing objects.
System VariablesAFLAGS
Sets options for attributes.
ATTIPE
Controls the display
of the in-place editor used to create multiline attributes.
ATTMULTI
Controls whether multiline
attributes can be created.